-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Numpy add numpy op hanning, hamming, blackman #15815
Conversation
9ecd328
to
14fc78f
Compare
6cd146e
to
bea9be8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase to the master and solve conflicts after resolving comments.
python/mxnet/ndarray/numpy/_op.py
Outdated
|
||
|
||
@set_module('mxnet.ndarray.numpy') | ||
def hanning(M, dtype=_np.float64, ctx=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default dtype is float32.
python/mxnet/ndarray/numpy/_op.py
Outdated
|
||
|
||
@set_module('mxnet.ndarray.numpy') | ||
def hanning(M, dtype=None, ctx=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still prefer to use float64 as the default type in the function argument instead of having a checker at the beginning of the function. The reason is that the type of dtype
would be Union[None, str, numpy.dtype]
in the current implementation, which is inconsistent with the docstring saying that dtype : str or numpy.dtype
. Also, it makes the semantic ambiguous and should be avoided especially in Python 3.7. If the default value of dtype
in the argument is np.float64
or 'float64' then we can enforce its type to be Union[str, numpy.dtype]
as documented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's good, i think i should use float32 as the defaulet type,
c1ac152
to
d5754e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I don't have further comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
address test file fix test file make default dtype is float32
address test file fix test file make default dtype is float32
address test file fix test file make default dtype is float32
Description
(Brief description on what this PR is about)
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments